package com.qf.service;

import com.qf.dao.EmpManagerDao;
import com.qf.dao.EmpManagerDaoImpl;
import com.qf.pojo.EmpManager;

/**
 * @author 千锋健哥
 */
public class EmpManagerServiceImpl implements EmpManagerService{

    @Override
    public boolean login(String userName, String passWord) {
        //1. 查询并返回结果
        EmpManagerDao empManagerDao = new EmpManagerDaoImpl();
        EmpManager empManager = empManagerDao.findManagerByUserName(userName);

        //2. 判断如果查询不到则返回false
        if (empManager == null) {
            return false;
        }

        //3. 判断密码是否正确
        if (empManager.getPassWord().equals(passWord)) {
            return true;
        } else {
            return false;
        }
    }

}
